package com.cseg674.dataentry.javaparser;
/*
 * RdfNestInterface.java
 *
 * Created on February 28, 2008, 3:12 PM
 *
 */

/**
 *
 * @author Tian, Juan
 */
import java.util.LinkedList;

/**
 * RdfNestInterface provides the information about the methods, fields and interfaces of the nested class' interface in the RDF output.
 */

public class RdfNestInterface extends RdfTreeNode{

    /**
	 * Contains the list of methods that are within the Nested Interface
	 */
    private LinkedList<RdfMethod> methods;

    /**
	 * Contains the list of fields that are within the Nested Interface
	 */
    private LinkedList<RdfField> fields;

    /**
	 * Contains the list of interfaces implemented by the Nested Interface
	 */
    private LinkedList <String> superInterfaces;

    /**
	 * Default Constructor: Creates a new instance of RdfNestInterface
     */
    public RdfNestInterface() {
        this("default");
    }

    /**
	 * Constructor: Creates a new instance of RdfNestInterface
	 *
	 * @param perfix	the name of the Method
     */
    public RdfNestInterface(String perfix) {
        this(perfix, null, null);
    }

    /**
	 * Constructor: Creates a new instance of RdfNestInterface
	 *
	 *  @param name	the name of the Nested Interface
	 *  @param type	the type of the Nested Interface
     */
    public RdfNestInterface(String name, String type){
        this("default", name, type);
    }

    /**
	 * Constructor: Creates a new instance of RdfNestInterface
	 *
	 * @param perfix	the prefix of the Nested Interface
	 * @param name		the name of the Nested Interface
	 * @param type		the type of the Nested Interface
     */
    public RdfNestInterface(String perfix, String name, String type) {
        super(perfix, name, type);
        methods = new LinkedList <RdfMethod>();
        fields = new LinkedList <RdfField>();
        superInterfaces = new LinkedList <String>();
    }

    /**
     * gets the methods in this Nested Interface
     *
     * @return	list of methods in this Nested Interface
     */

    public LinkedList<RdfMethod> getMethods() {
        return methods;
    }

    /**
     * gets the field in this Nested Interface
     *
     * @return	list of field in this Nested Interface
     */

    public LinkedList<RdfField> getFields() {
        return fields;
    }

    /**
     * gets the interfaces extended by this Nested Interface
     *
     * @return	list of interfaces extended by this Nested Interface
     */

    public LinkedList <String> getSuperInterfaces() {
        return superInterfaces;
    }

    /**
     * adds the interface 's' to the list of interfaces extended by this Nested Interface
     *
     * @param s	the interface extended by this Nested Interface
     * @return	<code>true</code> if the interface was successfully added to the 'superinterfaces' list
     */

  	public boolean addSuperInterface(String s) {
        return superInterfaces.add(s);
    }

    /**
     * adds the Method 'a' to the list of methods within this Nested Interface
     *
     * @param a	the Method within this Nested Interface
     * @return	<code>true</code> if the Method was successfully added to the 'methods' list
     */

    public boolean addMethod(RdfMethod a) {
        return methods.add(a);
    }

    /**
     * adds the Field 'a' to the list of fields within this Nested Interface
     *
     * @param a	the Field within this Nested Interface
     * @return	<code>true</code> if the Field was successfully added to the 'fields' list
     */

    public boolean addField(RdfField a) {
        return fields.add(a);
    }


}
